package com.hengda.museumonline.view;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * @author：JFWU on 2016/10/10 20:18
 * @E-mail：jeffy12138@126.com
 */
public class EngineeringRecyclerView extends RecyclerView {
    public int downY;
    public int downX;

    public EngineeringRecyclerView(Context context) {
        super(context);
    }

    public EngineeringRecyclerView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public EngineeringRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }


    @Override
    public boolean onInterceptTouchEvent(MotionEvent e) {
        switch (e.getAction()) {
            case MotionEvent.ACTION_DOWN:
                downY = (int) e.getY();
                downX = (int) e.getX();
                break;
            case MotionEvent.ACTION_MOVE:
                int moveY = (int) e.getY();
                int moveX = (int) e.getX();
                int diffY = moveY - downY;
                int diffX = moveX - downX;
                break;
            default:
                break;

        }
        return super.onInterceptTouchEvent(e);
    }
}
